import Vue from "vue";
import router from '../router';
import store from '../store'
export default {
  mustBeLogin() {
    let token = localStorage.getItem('token');
    if (!token) {
      Vue.prototype.$toast('请先登录');
      store.commit('isGoBack/chanisGoBack', true);
      setTimeout(() => {
        router.push('/user')
      }, 500)
      return false;
    }
    return true;
  }
}